package fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageButton;

import com.xiyoumobile.dengtuo.flowershop.R;

import javahtml5.JsDetailActivity;
import javahtml5.JsMainActivity;

/**
 * Created by Admin on 2016/3/8.
 */
public class FirstLookFragment extends Fragment {


    WebView webView;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.firstlook_index, null);
        findView(view);
        return view;
    }

    private void findView(View view) {


        webView = (WebView) view.findViewById(R.id.webView);
        // WebView打开权限
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setSupportZoom(true);

        webView.setWebViewClient(new WebViewClient());
        JsMainActivity javaSrcipt =
                new JsMainActivity(getContext(), webView);
        webView.addJavascriptInterface(javaSrcipt, "native");
        webView.loadUrl("file:///android_asset/shop.html");
    }
}
